Repository navigation
Accept validated headerless SSE from Responses provider - #15
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Evidence
Production TopkAPI Actions run 43627763636 received upstream HTTP 200,
content_type_category=missing,body_present=truefrom the public Responses endpoint and failedprovider_stream_content_type_invalid. An independently reported Codex streaming gateway case also documents HTTP 200 with an SSE body and no Content-Type, but on a distinct endpoint; therefore actual upstream body shape is not yet established here.Change
For successful Responses responses with missing Content-Type only, peek at most 64 bytes from a cloned response to require an
event:ordata:SSE prefix. Then feed the original body into the existing boundedsafeEventsverifier, which requires a terminalresponse.completed; all failures remain fail closed. A present JSON/HTML/other media type stays rejected. Existing sanitized diagnostics, credential isolation, fixed upstream endpoint and origin/transport policies are unchanged.Safety and rollout
This is a proposed production fix, not proof of a successful live review. Check CI and run full synthetic Docker/SSE and security tests before approval. No live inference was performed. Do not merge or deploy automatically. Because the runner is immutable-pinned, a coordinated Worker trust/caller SHA update is required after squash merge. Keep auto-merge disabled. One new owner-authorized review is needed only after deployment and credential-only diagnostics.
Reference: QuantumNous/new-api#6075 (analogous headerless SSE behavior on a different endpoint).